<?php
	session_start();
	$Noe = $_SESSION["NoE"];
	$dec = $_SESSION['decision'];
	$counter = 0;
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Результаты</title>
	<link rel="stylesheet" href="../css/style.css">
	<link rel="shortcut icon" href="https://bsquare.co.in/assets/php_icon.png">
</head>
<body>
	<div class="content-wraper">
		<div class="content">
			<?php
				foreach ($dec as $key => $value) {
					if ($value == $_GET["q".$key]){
						$counter++;
					}
				}
				$resl = $counter / $Noe * 100;
				if ($resl >= 90){
					$estimation = 5;
				}else if ($resl < 90 && $resl >= 70){
					$estimation = 4;
				}else if ($resl < 70 && $resl >= 50){
					$estimation = 3;
				}else if ($resl < 50) {
					$estimation = 2;
				}
				echo "<span>Результат: ".$resl."% "." (". $estimation. ")</span>";
			?>
			<a href="/"><button type="button">На главную</button></a>
		</div>
	</div>
</body>
</html>